package exam.jingdong.S2;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static int n;
    public static int[] nums;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        nums = new int[n];
        for (int i=0; i<n; ++i)
            nums[i] = sc.nextInt();
        System.out.println(solution());
    }

    private static int solution() {
        Map<Integer, Integer> map1 = new HashMap<>();
        Map<Integer, Integer> map2 = new HashMap<>();
        for (int i=0; i<nums.length; ++i) {
            if (i % 2 == 0) {
                map1.put(nums[i], map1.getOrDefault(nums[i], 0) + 1);
            } else {
                map2.put(nums[i], map2.getOrDefault(nums[i], 0) + 1);
            }
        }
        int num1 = getMostNum(map1), num2 = getMostNum(map2);
        if (num1 == num2) {
            int num22 = getMostNum(map2, num1);
            if (num22 == Integer.MIN_VALUE)
                return n / 2;
            int res1 = getRes(num1, num22);
            int num11 = getMostNum(map1, num1);
            if (num11 == Integer.MIN_VALUE)
                return n / 2;
            int res2 = getRes(num11, num2);
            return Math.min(res1, res2);
        }
        return getRes(num1, num2);
    }

    private static int getRes(int num1, int num2) {
        int res = 0;
        for (int i=0; i<nums.length; ++i) {
            if (i % 2 == 0) {
                if (nums[i] != num1)
                    res++;
            } else {
                if (nums[i] != num2)
                    res++;
            }
        }
        return res;
    }

    private static int getMostNum(Map<Integer, Integer> cnt) {
        int maxNum = 0, maxCnt = 0;
        for (Map.Entry<Integer, Integer> entry : cnt.entrySet()) {
            if (entry.getValue() > maxCnt) {
                maxCnt = entry.getValue();
                maxNum = entry.getKey();
            }
        }
        return maxNum;
    }

    private static int getMostNum(Map<Integer, Integer> cnt, int target) {
        int maxNum = 0, maxCnt = 0;
        for (Map.Entry<Integer, Integer> entry : cnt.entrySet()) {
            if (entry.getValue() > maxCnt && entry.getKey() != target) {
                maxCnt = entry.getValue();
                maxNum = entry.getKey();
            }
        }
        return maxCnt == 0 ? Integer.MIN_VALUE : maxNum;
    }
}
